package com.ease.platform.access.service.impl;

import java.util.List;

import com.ease.model.DatabaseManyToManyConstraint;
import com.ease.model.criteria.DatabaseManyToManyConstraintCriteria;
import com.ease.platform.access.service.DatabaseManyToManyConstraintAccessService;

/**
 * 
 * @author nathanleewei
 * 
 */
public class DatabaseManyToManyConstraintAccessServiceImpl extends AbstractParameterizedBeanJdbcTemplateAccessServiceImpl<DatabaseManyToManyConstraint> implements
		DatabaseManyToManyConstraintAccessService {

	public List<DatabaseManyToManyConstraint> findByClientTableName(String clientTableName) {

		DatabaseManyToManyConstraintCriteria criteria = new DatabaseManyToManyConstraintCriteria();
		criteria.setClientTableName(clientTableName);
		criteria.setOwner(owner);
		return this.find(criteria);
	}

	public List<DatabaseManyToManyConstraint> findByRelationshipTableName(String relationshipTableName) {
		DatabaseManyToManyConstraintCriteria criteria = new DatabaseManyToManyConstraintCriteria();
		criteria.setRelationshipTableName(relationshipTableName);
		criteria.setOwner(owner);
		return this.find(criteria);
	}

	public List<DatabaseManyToManyConstraint> find(String clientTableName, String relationshipTableName) {
		DatabaseManyToManyConstraintCriteria criteria = new DatabaseManyToManyConstraintCriteria();
		criteria.setClientTableName(clientTableName);
		criteria.setRelationshipTableName(relationshipTableName);
		criteria.setOwner(owner);
		return this.find(criteria);
	}
}
